import request from '@/utils/request'
import { encrypt } from '@/utils/rsaEncrypt'

export function add(data) {
  return request({
    url: 'api/users/add',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/users/delete',
    method: 'post',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/users/edit',
    method: 'post',
    data
  })
}

export function updatePass(user) {
  const data = {
    oldPassword: user.oldPassword,
    newPassword: user.newPassword
  }
  return request({
    url: 'api/users/modifyPwd/',
    method: 'post',
    data
  })
}

export function listConsultant(id) {
  return request({
    url: 'api/users/listConsultant/' + id,
    method: 'get'
  })
}
export default { add, edit, del, listConsultant }

